package cn.hchaojie.web.day04;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

public class ServletContextStartupListener2 implements ServletContextListener {
	@Override
	public void contextInitialized(ServletContextEvent sce) {
		
		System.out.println("servletcontext2 初始化完成。。。");
		
		// 
		ServletContext context = sce.getServletContext();
		String logFile = context.getInitParameter("logFile");
		System.out.println(logFile);
		
		context.setAttribute("logFile", logFile);
	}

	/**
	 * @param sce
	 */
	@Override
	public void contextDestroyed(ServletContextEvent sce) {
		System.out.println("servletcontext2 销毁。。。");
	}

}
